/*
 * @Description: 
 * @Author: zoe
 * @Date: 2024-09-04 16:33:23
 * @LastEditors: rendc
 * @LastEditTime: 2024-09-04 17:23:30
 */
public class TestSt2{
    public static int getMax(int[] array){
        int max = 0;
        //循环遍历数组
        for(int i = 0;i<array.length;i++){、
            //判断当前元素是否大于最大值
            if(array[i]>max){
                //将最大值赋值给max
                max = array[i];
            }
        }
        return max;
    }
    public static void main(String[] args){
        int array[] = new int[]{1,2,3,4,5,12,11};
        System.out.println("max:"+getMax(array));
    }
}
